import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/login',
      component: () => import('@/views/Login/index.vue')
    },
    {
      path: '/',
      component: () => import('@/views/Layout/index.vue'),
      children: [
        {
          path: '',
          component: () => import('@/views/Home/index.vue')
        },
        {
          path: '/cart',
          component: () => import('@/views/Cart/index.vue')
        },
        {
          path: '/detail/:id',
          component: () => import('@/views/Detail/index.vue')
        },
        {
          path: '/check',
          component: () => import('@/views/Check/index.vue')
        },
        {
          path: '/pay/:id',
          component: () => import('@/views/Pay/index.vue')
        },
        {
          path: '/member',
          component: () => import('@/views/Member/index.vue'),
          children: [
            {
              path: '/member/avator',
              component: () => import('@/views/Member/component/avatorInf.vue')
            },
            {
              path: '/member/like',
              component: () => import('@/views/Member/component/youLike.vue')
            }
          ]
        }
      ]
    }
  ]
})

export default router
